package cn.com.open.itembank.service;

import cn.com.open.itembank.entity.QuestionCategory;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * Created by lucky on 2017/9/28.
 */

@FeignClient(name = "item-base-service")
public interface QuestionCategoryRemoteService {
    /**
     * 根据试题应用类别id获取可用试题应用类别信息.
     *
     * @param id 试题应用类别id
     * @return 可用题库信息 question category info
     */
    @GetMapping(value = "/questioncategory/{id}")
    QuestionCategory getQuestionCategoryInfo(@PathVariable(value = "id") String id);

    /**
     * 根据试题应用类别名称串获取试题应用类别id串.
     *
     * @param names 试题应用类别名称串，逗号分割
     * @return the string
     */
    @GetMapping("/questioncategory/ids")
    String getIdsFromNames(@RequestParam(value = "names") String names);

    /**
     * 获取可用试题应用类别名称信息
     *
     * @param name 试题应用类别名称
     * @return the list
     */
    @GetMapping("/questioncategory/enabledlist")
    List<QuestionCategory> getEnabledList(@RequestParam(value = "name") String name);
}
